﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using COM.OA.Entity;
using COM.OA.BLL;


public partial class linminchao_bbs_lt_addlt : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        users loginuser = Session["loginuser"] as users;
        if (loginuser == null)
        {
            this.Response.Write(string.Format(GetRedirect.ALLREDIRECT, "../../login.aspx"));
        }

    }
    protected void submit2_ServerClick(object sender, EventArgs e)
    {
        users loginuser = Session["loginuser"] as users;
        bbs bb = new bbs();
        bb.bbs_title = this.biaoti.Value;//标题
        bb.bbs_content = this.FreeTextBox1.Text;//内容
        bb.bbs_dept_id = 1;//部门ID
        bb.bbs_releasetime = DateTime.Now;//当前时间
        bb.bbs_reads = 0;//阅读次数
        bb.bbs_reverts = 0; //恢复次数
        bb.bbs_author = loginuser.u_id.ToString();
        int i = bbsBLL.Insert(bb);
        if (i < 0)
        {
            this.Response.Write(string.Format(GetRedirect.WINALERT, "添加帖子成功！"));
            this.Response.Write(string.Format(GetRedirect.REDIRECT, "lt_lookbbs.aspx"));
        }
        else 
        {
            this.Response.Write(string.Format(GetRedirect.WINALERT, "添加帖子失败！"));
        }
    }
}
